<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="949.43">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Helvetica; color: #000000}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Helvetica; color: #000000; min-height: 22.0px}
p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; color: #000000}
p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; color: #000000; min-height: 14.0px}
p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 15.0px Helvetica; color: #000000}
p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #000000}
p.p7 {margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #000000; min-height: 14.0px}
p.p8 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #000000}
span.s1 {font: 18.0px Helvetica}
span.s2 {font: 10.0px Monaco}
span.s3 {color: #000000}
span.s4 {font: 9.0px Monaco}
span.Apple-tab-span {white-space:pre}
</style>
</head>
<body>
<p class="p1"><span class="s1"><b>AtsNoiSynth<span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></b></span><b>Resynthesize sine and noise data from an ATS analysis file</b></p>
<p class="p2"><br></p>
<p class="p3"><b>AtsNoiSynth.ar(atsbuffer, numPartials, partialStart, partialSkip, filePointer, sinePct, noisePct, freqMul,</b></p>
<p class="p3"><b><span class="Apple-tab-span">	</span>freqAdd, numBands, bandStart, bandSkip, mul, add)</b></p>
<p class="p4"><b><span class="Apple-tab-span">	</span></b></p>
<p class="p3"><b>- resynthesizes information from an ATS file, with transformations.</b></p>
<p class="p4"><br></p>
<p class="p3"><b><span class="Apple-tab-span">	</span>atsbuffer -<span class="Apple-converted-space"> </span></b> the buffer number that contains the AtsFile information</p>
<p class="p3"><b><span class="Apple-tab-span">	</span>numPartials - </b>the number of partials to synthesize</p>
<p class="p3"><b><span class="Apple-tab-span">	</span>partialStart -</b> the partial in the analysis to start the synthesis on. Partial 0 is the first partial.</p>
<p class="p3"><b><span class="Apple-tab-span">	</span>partialSkip -</b> an integer that indicates the increment from partialStart of which partials to synthesize.</p>
<p class="p3"><b><span class="Apple-tab-span">	</span>filePointer -</b> a value (between 0 and 1) that indicates which part of the file to synthesize.<span class="Apple-converted-space">  </span>Accepts ugens<span class="Apple-converted-space"> </span></p>
<p class="p3"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>or a static value.</p>
<p class="p3"><b><span class="Apple-tab-span">	</span>sinePct - </b>a scaler on the sinusoidal portion of the resynthesis.</p>
<p class="p3"><b><span class="Apple-tab-span">	</span>noisePct -</b> a scaler on the noise portion of the resynthesis.</p>
<p class="p3"><b><span class="Apple-tab-span">	</span>freqMul -</b> a multiplier on the sinusoidal frequency information.</p>
<p class="p3"><b><span class="Apple-tab-span">	</span>freqAdd - </b>a value to add to frequency information.</p>
<p class="p3"><span class="Apple-tab-span">	</span><b>numBands -</b> the number of critical bands (noise) to synthesize.<span class="Apple-converted-space">  </span>There are 25 critical bands.</p>
<p class="p3"><span class="Apple-tab-span">	</span><b>bandStart -</b> the critical band to start resynthesis on. Partial 0 is the first band.</p>
<p class="p3"><span class="Apple-tab-span">	</span><b>bandSkip</b> - an integer that indicates the increment from bandStart of which bands to synthesize.</p>
<p class="p4"><span class="Apple-tab-span">	</span></p>
<p class="p3"><b>**WARNING** </b>If you try to resynthesize partials or bands that don't exist, those partials will fail silently.<span class="Apple-converted-space">  </span>All valid partials will still be synthesized.</p>
<p class="p4"><br></p>
<p class="p5"><b>Usage</b></p>
<p class="p4"><span class="Apple-tab-span">	</span><span class="Apple-converted-space"> </span></p>
<p class="p3">For resynthesis purposes, an ATS file needs to be loaded into a buffer.<span class="Apple-converted-space">  </span>When loading an ATS file, you need to supply a buffer number to store ATS data in.</p>
<p class="p4"><br></p>
<p class="p6">s.boot;</p>
<p class="p7"><br></p>
<p class="p6">a = AtsFile.new("sounds/a11wlk01.ats").load;</p>
<p class="p7"><br></p>
<p class="p6">( //play just the resynth, with LFSaw pointing into the file</p>
<p class="p6">{</p>
<p class="p6"><span class="Apple-tab-span">	</span>AtsNoiSynth.ar(a.bufnum, a.numPartials, 1, 1,<span class="Apple-converted-space"> </span></p>
<p class="p8"><span class="s2"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>filePointer: </span>LFSaw.kr(a.sndDur.reciprocal, 1, 0.5, 0.5)<span class="s2">, noisePct: 1, mul: 1)</span></p>
<p class="p6"><span class="Apple-tab-span">	</span>}.play(s);</p>
<p class="p3">);</p>
<p class="p4"><br></p>
<p class="p6">( //play noise only, don't resynthesize sine info</p>
<p class="p6">{</p>
<p class="p6"><span class="Apple-tab-span">	</span>AtsNoiSynth.ar(a.<span class="s3">bufnum</span>, 0, 0, 1, filePointer: <span class="s4">LFSaw.kr(a.sndDur.reciprocal, 1, 0.5, 0.5)</span>, <span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>mul: 1)</p>
<p class="p6"><span class="Apple-tab-span">	</span>}.play(s);</p>
<p class="p3">);</p>
<p class="p4"><br></p>
<p class="p6">( //resynthesize every other noise band</p>
<p class="p6">{</p>
<p class="p6"><span class="Apple-tab-span">	</span>AtsNoiSynth.ar(a.<span class="s3">bufnum</span>, 0, 0, 1, filePointer: <span class="s4">LFSaw.kr(a.sndDur.reciprocal, 1, 0.5, 0.5)</span>,<span class="Apple-converted-space"> </span></p>
<p class="p6"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>numBands: 12, bandStart: 1, bandSkip: 2, mul: 10)</p>
<p class="p6"><span class="Apple-tab-span">	</span>}.play(s);</p>
<p class="p3">);</p>
<p class="p4"><br></p>
<p class="p6">( //resynthesize only the upper bands of noise</p>
<p class="p6">{</p>
<p class="p6"><span class="Apple-tab-span">	</span>AtsNoiSynth.ar(a.<span class="s3">bufnum</span>, 0, 0, 1, filePointer: <span class="s4">LFSaw.kr(a.sndDur.reciprocal, 1, 0.5, 0.5)</span>,<span class="Apple-converted-space"> </span></p>
<p class="p6"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>numBands: 12, bandStart: 12, bandSkip: 1, mul: 10)</p>
<p class="p6"><span class="Apple-tab-span">	</span>}.play(s);</p>
<p class="p3">)</p>
<p class="p4"><br></p>
</body>
</html>
